<?php 
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
require 'jtools.inc';
require 'mysql_connect.php';

$vFirstName		= $_REQUEST["pFirstName"];
$vLastName		= $_REQUEST["pLastName"];
$vEmail			= $_REQUEST["pEmail"];
$vCompany		= $_REQUEST["pCompany"];
$vAddress1		= $_REQUEST["pAddress1"];
$vAddress2		= $_REQUEST["pAddress2"];
$vState			= $_REQUEST["pState"];
$vZip			= $_REQUEST["pZip"];
$vFacebook		= $_REQUEST["pFacebook"];
$vRefID			= $_REQUEST["pRefID"];
$vOfficePhone	= $_REQUEST["pOfficePhone"];
$vMobilePhone	= $_REQUEST["pMobilePhone"];
$vCredential	= $_REQUEST["pCredential"];
$vWebsite		= $_REQUEST["pWebsite"];
$vCounty		= $_REQUEST["pCounty"];
$vTwitter		= $_REQUEST["pTwitter"];
$vBrokerPhone	= $_REQUEST["pBrokerPhone"];
$vBrokerEmail	= $_REQUEST["pBrokerEmail"];
$vSubmit		= $_REQUEST["pSubmit"];



$vAllowedExts = array("jpg", "jpeg", "gif", "png");
if (strlen($_FILES["pPhoto"]["name"]) > 0) {
	$vExtension = end(explode(".", $_FILES["pPhoto"]["name"]));
	if ((($_FILES["pPhoto"]["type"] == "image/gif") || ($_FILES["pPhoto"]["type"] == "image/jpeg") || ($_FILES["pPhoto"]["type"] == "image/pjpeg")) && in_array($vExtension, $vAllowedExts)) {
		if ($_FILES["pPhoto"]["error"] == 0) {
			$vNewFileName = "photos/" . $_COOKIE["RealtyAppCookie_AgentID"] . '.' . $vExtension;
			if (file_exists($vNewFileName)) {
				chmod($vNewFileName, 0755); 		//Change the file permissions if allowed
				unlink($vNewFileName); 				//remove the file
			}
			move_uploaded_file($_FILES["pPhoto"]["tmp_name"], "photos/" . $_COOKIE["RealtyAppCookie_AgentID"] . '.' . $vExtension);
			$vPhoto = $vExtension;
		} else {
			$vMessage = 'Sorry, there was an error uploading your Photo file.<BR>';
		}
	} else {
		$vMessage = "Sorry, invalid Photo file type please use a jpg, png, or gif.<BR>";
	}
}
$vExtension = end(explode(".", $_FILES["pLogo"]["name"]));
if (strlen($_FILES["pLogo"]["name"]) > 0) {
	if ((($_FILES["pLogo"]["type"] == "image/gif") || ($_FILES["pLogo"]["type"] == "image/jpeg") || ($_FILES["pLogo"]["type"] == "image/pjpeg")) && in_array($vExtension, $vAllowedExts)) {
		if ($_FILES["pLogo"]["error"] == 0) {
			$vNewFileName = "logos/" . $_COOKIE["RealtyAppCookie_AgentID"] . '.' . $vExtension;
			if (file_exists($vNewFileName)) {
				chmod($vNewFileName,0755); 		//Change the file permissions if allowed
				unlink($vNewFileName); 			//remove the file
			}
			move_uploaded_file($_FILES["pLogo"]["tmp_name"], $vNewFileName);
			$vLogo = $vExtension;
		} else {
			$vMessage = 'Sorry, there was an error uploading your Logo file.<BR>';
		}
	} else {
		$vMessage = $vMessage . "Sorry, invalid Logo file type please use a jpg, png, or gif.<BR>";
	}
}

if (($vSubmit == 'Submit') && !isset($vMessage)) { //changes submited
	$vQuery="SELECT 1 FROM reagent WHERE UCASE(RefID)='" . strtoupper($vRefID) . "' AND idREAgent <>" . $_COOKIE["RealtyAppCookie_AgentID"];
	$rsIDs = mysql_query($vQuery) or die("Invalid query 1: " . mysql_error());
	if ((mysql_num_rows($rsIDs) == 0) && (strlen($vRefID) > 0)) { //ensure noone else has that refid
		$vQuery = "UPDATE reagent SET RefID='" . $vRefID . "', FirstName='" . $vFirstName . "', LastName='" . $vLastName . "', Email='" . $vEmail . "', Company='" . $vCompany . "', Address1='" . $vAddress1 . "', Address2='" . $vAddress2 . "', State='" . $vState . "', Zip='" . $vZip . "', Facebook='" . $vFacebook . "', OfficePhone='" . $vOfficePhone . "', MobilePhone='" . $vMobilePhone . "', Credential='" . $vCredential . "', Website='" . $vWebsite . "', County='" . $vCounty . "', Twitter='" . $vTwitter . "', BrokerPhone='" . $vBrokerPhone . "', BrokerEmail='" . $vBrokerEmail . "', Photo='" . $vPhoto . "', Logo='" . $vLogo . "' WHERE idREAgent=" . $_COOKIE["RealtyAppCookie_AgentID"];
		mysql_query($vQuery) or die("Invalid query 2: " . mysql_error());
		$vMessage = 'Changes have been saved succesfully.<BR>';
	} else {
		$vMessage = "Sorry, that Ref ID can not be used.<BR>";
	}

}


$rsAgents = mysql_query("SELECT FirstName, LastName, ContactInformation_idContactInformation, Address, AgentID, REOffice_idREOffice, ModificationTimestamp, OfficePhone, MobilePhone, Email, Company, Address1, Address2, Credential, Website, State, County, Zip, Twitter, Facebook, BrokerPhone, BrokerEmail, Photo, Logo FROM reagent WHERE idREAgent=" . $_COOKIE['RealtyAppCookie_AgentID'])  or die("Invalid query 1: " . mysql_error());
$rsAgent = mysql_fetch_array($rsAgents,MYSQL_BOTH);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <head><title></title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <meta name="abstract" content="" />
        <meta name="robots" content="All">
        <meta name="robots" content="noindex, nofollow">
        <meta name="copyright" content="Copyright " />
        <meta name="author" content="" />
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
        <meta content="no" http-equiv="imagetoolbar" />
        <title>Jasdip.co.uk # Mobile App Development Platform</title>
        <link rel="shortcut icon" href="http://www.appmanager.co.uk/admin_us_broker/favicon.ico"/>
        <link href="style.css" rel="stylesheet" type="text/css">
	<link href="css/slider.css" rel="stylesheet" type="text/css">
        <link href="css/style.css" media="all" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="css/jquery-ui-1.8.16.custom.css" type="text/css" media="screen" />
	<link rel="Stylesheet" type="text/css" href="css/jPicker-1.1.6.min.css" />

	<script src="js/jquery-1.6.2.min.js"  type="text/javascript"></script> 
	<script src="js/jquery-ui-1.8.16.custom.min.js"  type="text/javascript"></script>
	<script src="js/jquery.jcarousel.pack.js"  type="text/javascript"></script>
	<script src="js/jquery-func.js" type="text/javascript"></script>
		
	<script src="js/jpicker-1.1.6.min.js" type="text/javascript"></script>
	<!--<script src="js/jquery.js" type="text/javascript"></script>-->
	<script src="http://www.appmanager.co.uk/admin_us_broker/js/javascri.js" type="text/javascript"></script>
        <script src="js/jquery.getParams.js" type="text/javascript"></script>
        <script src="js/jquery.bestupper.min.js" type="text/javascript"></script>
        <script src="js/jquery.alphanumeric.js" type="text/javascript"></script>
        <script src="js/jquery.form-defaults.js" type="text/javascript"></script>
        <script src="js/textLimit.min.js" type="text/javascript"></script>
        <script src="js/ipublish.js" type="text/javascript"></script>
	<script src="js/iphone-style-checkboxes.js" type="text/javascript" charset="utf-8"></script>
                    <script src="js/brokers.js" type="text/javascript"></script>
                    <script src="js/clear_default_text.js" type="text/javascript"></script>
                    <script src="js/jquery.field.js" type="text/javascript"></script>
                    <script src="js/jquery.getParams.js" type="text/javascript"></script>
                    <script src="js/form_validator.js" type="text/javascript"></script>
        	<script type="text/javascript" charset="utf-8" src="js/site.js"></script>
	<script type="text/javascript" src="fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
	<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>
	<script type="text/javascript" src="js/ajaxfileupload.js"></script>
	<link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.4.css" media="screen" />
  </head>
    <body>
        <div class="outside2">

            <div class="header_wrap cc">


                <div class="header_wrap cc">
                    <script>

    $(document).ready(function(){
        $('[rel=tooltip]').bind('mouseover', function(){
            var theMessage = $(this).attr('content');
            $('<div class="tooltip">' + theMessage + '</div>').appendTo('body').fadeIn('fast');

            $(this).bind('mousemove', function(e){
                $('div.tooltip').css({
                    'top': e.pageY - ($('div.tooltip').height())+10,
                    'left': e.pageX +30
                });
            });
        }).bind('mouseout', function(){
            $('div.tooltip').fadeOut('fast', function(){
                $(this).remove();
            });
        });
    });
	
</script>
<div class="lftop">
    <a href="home.php" class="logo">
        <img src="images/logo/logo.png"/>
    </a>
</div>
<div class="right_topwrap">
    <div class="topwrap cc">
        <p class="phonetop">Phone Support (from 8am to 5pm): 212 209 1005	</p>
        <div class="agentwrap">
            <ul class="toplinks">
                <li class="notif_ic"><a href="brokers.php#" content="Powered by Digital Planit" rel="tooltip">&nbsp;</a></li>
                <li class="mail_ic"><a href="mailto:support@realtysmartapps.com">&nbsp;</a></li>
              
                <li class="help_ic"><a href="mailto:support@realtysmartapps.com" >&nbsp;</a></li>  
				<li class="settings_ic"><a href="app_property_settings.php">&nbsp;</a></li>            </ul>
        </div></div>
    <ul class="main_menu cc">
        <li class="homelk"><a href="home.php"><span>Home</span></a></li>
        <li  class="brokers"><a href="brokers.php"><span>My Details</span></a></li>        <li  class="testimonials"><a href="testimonials.php"><span>Testimonials</span></a></li>
        <!--li class="tour"><a href="tour.php"><span>Tour</span></a></li-->
        <li class="news"><a href="news.php"><span>News</span></a></li>
        <li class="abouttext"><a href="about-text.php"><span>About Text</span></a></li>
        <li class="stats"><a href="stats.php"><span>Stats</span></a></li>        <!--li class="images"><a href="images.php"><span>Images</span></a></li-->        <!--<li class="advert"><a href="adverts.php"><span>Adverts</span></a></li>
        <li class="notification"><a href="notifications.php"><span>Notification</span></a></li>
	<li class="payment "><a href="payment.php"><span>Payment</span></a></li>-->
        <li class="logout"><a href="login.php?pAction=<?=jencrypt('logout')?>"><span>Log Out</span></a></li>
    </ul>
</div>

<div id="menu">

</div>

</div>
                </div>
            </div>

            <div class="container_wrap">
                <div class="topshadow">&nbsp;</div>
<div class="lineshadow">
    <div class="middle cc">
        <div class="cc">
            <img src="images/jasdip_logo.png" class="piclg"/>
            <div class="introtext">
                <ul class="listlogos cc">
                </ul>
                <br>
                <h1 class="say-hello"><cufon class="cufon cufon-canvas" alt="Come " style="width: 54px; height: 20px;"><canvas width="68" height="20" style="width: 68px; height: 20px; top: 0px; left: -1px;"></canvas><cufontext>Come </cufontext></cufon><cufon class="cufon cufon-canvas" alt="on, " style="width: 31px; height: 20px;"><canvas width="45" height="20" style="width: 45px; height: 20px; top: 0px; left: -1px;"></canvas><cufontext>on, </cufontext></cufon><cufon class="cufon cufon-canvas" alt="say " style="width: 32px; height: 20px;"><canvas width="46" height="20" style="width: 46px; height: 20px; top: 0px; left: -1px;"></canvas><cufontext>say </cufontext></cufon><cufon class="cufon cufon-canvas" alt="hello!" style="width: 46px; height: 20px;"><canvas width="60" height="20" style="width: 60px; height: 20px; top: 0px; left: -1px;"></canvas><cufontext>hello!</cufontext></cufon></h1>
            </div>
        </div>
        <div class="contentpage">

            <h2>Details</h2>
            <p class="error_wrapper"><?=$vMessage?></p>
            <form action="brokers.php" method="post" enctype="multipart/form-data" name="formSalesPeople" id="formSalesPeople" class="addT cc" onsubmit="return validate_sales_people();" style="width: 615px;">
                <p>You can add and edit your details from this page.</p>
                <div class="col2" >
                    <p>First Name (*)</p>
                    <input class="cleardefault" name="pFirstName" id="txt_ASP_FirstName" type="text" value="<?=$rsAgent['FirstName']?>" MAXLENGTH="250" tabindex="100" />
                </div>
                <div class=
                     "col3">
                    <p>Office Phone (*)</p>
                    <input class="cleardefault" name="pOfficePhone" id="txt_ASP_Telephone_Office" type="text" value="<?=$rsAgent['OfficePhone']?>" MAXLENGTH="250" tabindex="108" />
                </div>	
                <div class="col2">
                    <p>Surname (*)</p>
                    <input class="cleardefault" name="pLastName" id="txt_ASP_Surname" type="text" value="<?=$rsAgent['LastName']?>" MAXLENGTH="250" tabindex="101" />
                </div>	
                <div class="col3">
                    <p>Mobile Phone (*)</p>
                    <input class="cleardefault" name="pMobilePhone" id="txt_ASP_Telephone_Mobile" type="text" value="<?=$rsAgent['MobilePhone']?>" MAXLENGTH="250" tabindex="109"/>
                </div>
                <div class="col2">
                    <p>Email Address (*)</p>
                    <input class="cleardefault" name="pEmail" id="txt_ASP_EmailAddress" type="text" value="<?=$rsAgent['Email']?>" MAXLENGTH="250" tabindex="102" />
                </div>
                <div class="col3">
					<p>My Credentials</p>
					<select id="txt_ASP_Credentials" name="pCredential" tabindex="105">
						<option value="">Select Credential</option>
						<?php $vSelected=''; if ($rsAgent['Credential'] == "1") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="1" >Licensed Real Estate Broker</option>
						<?php $vSelected=''; if ($rsAgent['Credential'] == "2") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="2" >Licensed Real Estate Salesperson</option>
						<?php $vSelected=''; if ($rsAgent['Credential'] == "3") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="3" >Licensed Associate Real Estate Broker</option>
					</select>
					</p>
                </div>
                <div class="col2">
					<p>Broker – Company Name (*)</p>
                    <input class="cleardefault" name="pCompany" id="txt_ASP_CompanyName" type="text" value="<?=$rsAgent['Company']?>" MAXLENGTH="50" tabindex="104" />
                </div>
                <div class="col3">
					<p>Broker Website URL</p>
                    <input class="cleardefault" name="pWebsite" id="txt_ASP_WebSiteURL" type="text" value="<?=$rsAgent['Website']?>" MAXLENGTH="250" tabindex="110"/>
                </div>
                <div class="col2">
					<p>Broker Office - Address 1 (*)</p>
                    <input class="cleardefault" name="pAddress1" id="txt_ASP_Address1" type="text" value="<?=$rsAgent['Address1']?>" MAXLENGTH="60" tabindex="103" />
                </div>
                
                <div class="col3">
					<p>Broker Office - Address 2</p>
                    <input class="cleardefault" name="pAddress2" id="txt_ASP_Address2" type="text" value="<?=$rsAgent['Address2']?>" MAXLENGTH="50" tabindex="111" />
                </div>
                
                <div class="col2">
					<p>Broker Office - State (*)</p>
					<select id="txt_ASP_State" name="pState" tabindex="105">
						<option value="">Select State</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "1") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="1">Alabama</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "2") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="2">Alaska</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "3") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="3">Arizona</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "4") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="4">Arkansas</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "5") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="5">California</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "6") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="6">Colorado</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "7") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="7">Connecticut</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "8") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="8">Delaware</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "9") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="9">Florida</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "10") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="10">Georgia</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "11") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="11">Hawaii</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "12") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="12">Idaho</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "13") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="13">Illinois</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "14") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="14">Indiana</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "15") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="15">Iowa</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "16") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="16">Kansas</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "17") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="17">Kentucky</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "18") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="18">Louisiana</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "19") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="19">Maine</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "20") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="20">Maryland</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "21") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="21">Massachusetts</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "22") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="22">Michigan</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "23") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="23">Minnesota</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "24") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="24">Mississippi</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "25") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="25">Missouri</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "26") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="26">Montana</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "27") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="27">Nebraska</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "28") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="28">Nevada</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "29") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="29">New Hampshire</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "30") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="30">New Jersey</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "31") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="31">New Mexico</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "32") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="32">New York</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "33") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="33">North Carolina</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "34") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="34">North Dakota</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "35") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="35">Ohio</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "36") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="36">Oklahoma</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "37") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="37">Oregon</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "38") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="38">Pennsylvania</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "39") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="39">Rhode Island</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "40") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="40">South Carolina</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "41") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="41">South Dakota</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "42") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="42">Tennessee</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "43") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="43">Texas</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "44") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="44">Utah</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "45") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="45">Vermont</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "46") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="46">Virginia</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "47") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="47">Washington</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "48") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="48">West Virginia</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "49") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="49">Wisconsin</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "50") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="50">Wyoming</option>
						<?php $vSelected=''; if ($rsAgent['State'] == "51") $vSelected=' SELECTED '; ?><option <?=$vSelected?> value="51">District of Columbia</option>
					</select>
                </div>
                <div class="col3">
					<p>Broker Office - County</p>
                    <input class="cleardefault" name="pCounty" id="txt_ASP_County" type="text" value="<?=$rsAgent['County']?>" MAXLENGTH="50" tabindex="112" />
                </div>
                
                <div class="col2">
					<p>Broker Office - Zip Code (*)</p>
                    <input class="cleardefault" name="pZip" id="txt_ASP_PostCode" type="text" value="<?=$rsAgent['Zip']?>" MAXLENGTH="10" tabindex="113" />
                </div>
                
                <div class="col3">
					<p>Broker Twitter URL</p>
                    <input class="cleardefault" name="pTwitter" id="txt_ASP_Twitter_URL" type="text" value="<?=$rsAgent['Twitter']?>" MAXLENGTH="110" tabindex="106" />
                </div>
                <div class="col2">
                    <p>Broker Facebook URL</p>
                    <input class="cleardefault" name="pFacebook" id="txt_ASP_Facebook_URL" type="text" value="<?=$rsAgent['Facebook']?>" MAXLENGTH="110" tabindex="114" />
                </div>
           
				<div class="col3">
					<p>Broker Phone</p>
                    <input class="cleardefault" name="pBrokerPhone" id="txt_ASP_Telephone_Broker" type="text" value="<?=$rsAgent['BrokerPhone']?>" MAXLENGTH="20" tabindex="115" />
				</div>
           
                <div class="col2" style="width:230px;">
                    <p>Ref ID (*)</p>
                    <input style="vertical-align: top;"class="cleardefault" name="pRefID" id="txt_ASP_RefID" type="text" value="<?=$_COOKIE['RealtyAppCookie_RefID']?>"  MAXLENGTH="10" readonly="readonly"/>
                    <div id="isrefidvalid" style="float:right;padding-left:10px"></div>
                    <a id="my_image_link" href="http://qrcode.kaywa.com/img.php?s=8&d=<?=strtoupper($_COOKIE['RealtyAppCookie_RefID'])?>" target="_blank">
                        <img id="my_image" style="width:90px;height:90px;display block"  src="http://qrcode.kaywa.com/img.php?s=8&d=<?=strtoupper($_COOKIE['RealtyAppCookie_RefID'])?>"/>
                    </a>
                </div>
                
                <div class="col3">
					<p>Broker Email Address </p>
                    <input class="cleardefault" name="pBrokerEmail" id="txt_ASP_EmailAddress_Broker" type="text" value="<?=$rsAgent['BrokerEmail']?>" MAXLENGTH="60" tabindex="117" />
                    
                    </br>
                    
                    <p>Photo
                		<?php if (strlen($rsAgent['Photo']) > 0) echo '
							<span style="float:right;margin-top:5px;margin-right:20px;">
								<a href="photos/' . $_COOKIE['RealtyAppCookie_AgentID'] . '.' . $rsAgent['Photo'] . '" target="_blank">View</a>&nbsp;&nbsp;
							</span>';
						?>
						     	</p>
                    <input type="file" name="pPhoto" id="txt_ASP_image" size="16" tabindex="107" style="float:left"/>&nbsp
                    
                    </br></br>
                    
                    <p>Broker – Logo
                         <?php if (strlen($rsAgent['Logo']) > 0) echo '
							<span style="float:right;margin-top:5px;margin-right:20px;">
								<a href="logos/' . $_COOKIE['RealtyAppCookie_AgentID'] . '.' . $rsAgent['Logo'] . '" target="_blank">View</a>&nbsp;&nbsp;
							</span>';
						?>               </p>
                    <input type="file" name="pLogo" id="txt_ASP_image_logo" size="16" tabindex="115" style="float:left"/>&nbsp
                </div>
                <div class="col2" id="isnamevalid" style="float:left;padding-left:10px"></div>
                                       
                <div class="col_button">
                    <input type="submit" value="Submit" class="submit_btn_salesp" tabindex="107" name="pSubmit"/>
                </div>
                <input name="txtASP_ID" type="hidden" id="ASP_ID" value="423" />
            </form>
        </div>
        <img src="images/iphone_pic.jpg" class="piccontent2"/>
    </div>
</div>
            </div>	

            <div class="footer_wrap2 cc">
                <div class="bgfooter cc">
                    <div id="footer" style="height:5px;">
   
    
    <div id="livechat">
       <!--Start of Zopim Live Chat Script-->
<script type="text/javascript">

window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
_.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8');
$.src='//cdn.zopim.com/?EY1bhMwTGUgOJq2RAZUjK8xKzvolaxRf';z.t=+new Date;$.
type='text/javascript';e.parentNode.insertBefore($,e)})(document,'script');

</script>
<!--End of Zopim Live Chat Script-->
    </div>
    <!--p class="privacy"><a href="privacy-statement.php">Privacy Statement</a></p-->
</div>

                </div>

            </div>

        </div>

        <script type="text/javascript">
            
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-19667077-4']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
            
        </script>	

    </body>
</html>